package demo2;

public class Test {
    public static void main(String[] args) throws CloneNotSupportedException{
        People people1 = new People(18,"lisi");
        People people2 = (People) people1.clone();
        System.out.println(people1.name);
        System.out.println(people1.age);
        System.out.println(people1.money.money);
        System.out.println("------------");
        System.out.println(people2.name);
        System.out.println(people2.age);
        System.out.println(people2.money.money);
        System.out.println("------------");
        people1.age = 20;
        System.out.println(people1.age);
        System.out.println(people2.age);
        System.out.println("------------");
        people1.money.money = 10;
        System.out.println(people1.money.money);
        System.out.println(people2.money.money);
    }
}
